﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Biz;
using Biz.UserManagement;

namespace Biz.Facade
{
    
    class PaymentTransaction
    {
        private string employeeCode = string.Empty;

        public string EmployeeCode
        {
            get { return employeeCode; }
            set { employeeCode = value; }
        }
        private decimal amount = 0;

        public decimal Amount
        {
            get { return amount; }
            set { amount = value; }
        }

        public Application application
        {
            get { return application; }
            set { application = value; }
        }

        public PaymentTransaction(Application application) { }


        //使用外观模式，对于接待赠答不同的类型做处理
        public bool Pay()
        {
            if (application.PRODUCT_NAME == "TREAT")
            {
                PayTreat paytreat = new PayTreat(application);
                return paytreat.Pay();
            }
            else if (application.PRODUCT_NAME == "PRESENT")
            {
                PayPresent paypresent = new PayPresent(application);
                return paypresent.Pay();
            }
            return false;
        }



    }
}
